/**   
*  页面加载等待页面 
*/    

var default_left;  
var default_top;

var height = window.screen.height-180;     
var width = window.screen.width;     
 var leftW = 300;     
 if(width>1200){     
    leftW = 500;     
 }else if(width>1000){     
    leftW = 350;     
 }else {     
    leftW = 100;     
 }     
      
// var _html = "<div id='loading' style=\"position:absolute;left:0;width:100%;height:" + height   
// + "px;top:0;background:#E0ECFF;opacity:0.8;filter:alpha(opacity=80);\"><div style=\"position:absolute;  cursor1:wait;left:"+leftW+"px;top:200px;width:auto;height:16px;padding:12px 5px 10px 30px;background:#fff url('http://localhost:8888/ptp/css/images/pagination_loading.gif') no-repeat scroll 5px 14px;border:2px solid #ccc;color:#000;\">正在加载，请等待...</div></div>";     
 
 var _html = "<div id='loading' style=\"position:absolute;left:0;width:100%;height:" + height +  
 			"px;top:0;background:#E0ECFF;opacity:0.4;filter:alpha(opacity=40);\"><div style=\"position:absolute;  cursor1:wait;left:"+leftW+"px;top:200px;width:auto;height:16px;padding:12px 5px 10px 30px;background:#fff no-repeat scroll 5px 14px;border:2px solid #ccc;color:#000;\">正在处理，请等待...</div></div>";

 function startMask(){  
    $("#loadmsg").html(_html);  
 }  
   
 function endMask(){  
    var _mask = document.getElementById('loading');  
    if(_mask!=null){  
        _mask.parentNode.removeChild(_mask);  
    }     
 } 
 
 function startMaskInfo() {
 	$('#div_loadmsg').css("display","block"); 
	$('#div_loadmsg').dialog({   
	    title:'',
	    modal:true,
	    width: '170',  
	    height: '50',
	    closable:false,
	    top:'40%',
	    align:'center',
	    fixed: true,  
	    resize: false,  
	    drag: false,
		onOpen:function(){   
			//dialog原始left  
			default_left=$('#div_loadmsg').panel('options').left;   
			//dialog原始top  
		 	default_top=$('#div_loadmsg').panel('options').top;                     
		},
		onMove:function(left,top){  //鼠标拖动时事件  
			var body_width=document.body.offsetWidth;//body的宽度  
			var body_height=document.body.offsetHeight;//body的高度  
			var dd_width= $('#div_loadmsg').panel('options').width;//dialog的宽度  
			var dd_height= $('#div_loadmsg').panel('options').height;//dialog的高度                 
			if(left<1||left>(body_width-dd_width)||top<1||top>(body_height-dd_height)){  
		    	$('#div_loadmsg').dialog('move',{      
		        	left:default_left,      
		       		top:default_top      
		   		});    
		   	}  
		}
	});
}

function endMaskInfo(){  
    $('#div_loadmsg').dialog('close');     
 }
 